<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: LQ
  Date: 2021/5/19
  Time: 19:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="/jQuery/jquery-3.4.1.min.js"></script>
</head>
<body>
<div>
    <jsp:include page="main.jsp"/>
</div>
<div style="margin-left: 30%;margin-top: 1%">
    <form action="/saveLink" method="post">
        输入链接名称<input type="text" name="linkName">
        输入链接地址<input type="text" name="linkAddress">
        <input type="submit">
    </form>

    <table border="1px">
        <tr>
            <th>名称</th>
            <th>链接</th>
            <th>操作</th>
        </tr>

        <c:forEach items="${requestScope.linkList}" var="link">
            <tr>
                <th>${link.linkName}</th>
                <th><a href="https://${link.linkAddress}">${link.linkAddress}</a></th>
                <th>
                    <form action="/deleteLink?lId=${link.linkId}" method="post">
                        <button>删除</button>
                    </form>
                </th>
            </tr>
        </c:forEach>
    </table>
</div>


</body>
</html>
